// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获取文章列表 GET /api/article */
export async function article(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.Result>('/admin-api/Article/LoadArticleList', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 多操作 POST /api/article */
export async function moreActionArticle(options?: { [key: string]: any }) {
  return request<API.Result>('/admin-api/Article/MoreActionArticle', {
    method: 'POST',
    data: {
      ...(options || {}),
    }
  });
}

/** 新建文章 POST /api/article */
export async function addArticle(options?: { [key: string]: any }) {
  return request<API.Result>('/admin-api/Article/AddArticle', {
    method: 'POST',
    data: {
      ...(options || {}),
    }
  });
}

/** 更新文章 PUT /api/article */
export async function updateArticle(options?: { [key: string]: any }) {
  return request<API.Result>('/admin-api/Article/UpdateArticle', {
    method: 'POST',
    data: {
      ...(options || {}),
    }
  });
}

/** 删除文章 DELETE /api/article */
export async function removeArticle(options?: { [key: string]: any }) {
  return request<API.Result>('/admin-api/Article/DeleteArticle', {
    method: 'GET',
    params: {
      ...(options || {}),
    }
  });
}